#include "DetectHash.h"

#include <iostream>
using namespace std;



int main()
{
	DetectHash hash;
	int ivalue = 0;
	while (cin >> ivalue)
	{
		if (ivalue == 44)
			break;
		if (ivalue == 999)
			hash.desc();

		if (ivalue == 444)
		{
			cin >> ivalue;
			hash.remove(ivalue);
			continue;
		}

		hash.insert(ivalue);
	}


	system("pause");

	return 0;
	

}